<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // 拓展运算符...
    // 1.复制数组/对象，...数组/对象名,将该数组中所有元素复制给新数组
    let arr = [11,22,33]
    let arr2 = [...arr]
    arr2.push(44)
    console.log(arr)
    let obj1 = {
        id: 10001,
        name: 'Bit',
        age: 9,
        address: '陕西省西安市⾼新区沣惠南路34号'
    }
    let obj2 = {
        ...obj1
    }
    obj2.age = 18
    console.log(obj1)

    // 2.合并数组/对象 ...数组/对象名，...数组/对象名(可以一直合并)，对象中，存在相同键时，后面的覆盖前面的键值对
    let arr3 = [...arr,...arr2]
    console.log(arr3)
    let obj = {...obj1,...obj2}
    console.log(obj)
</script>
</html>